package org.example;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Hello world!
 *
 */

@SpringBootApplication
public class BIgEventApplication
{
    public static void main( String[] args ) {
        SpringApplication.run(BIgEventApplication.class,args);

    }
    //在 Spring Boot 启动日志中，检查 MyBatis 的配置是否正确加载
    @Bean
    public CommandLineRunner printMyBatisConfig(SqlSessionFactory sqlSessionFactory) {
        return args -> {
            System.out.println("MyBatis Configuration: " + sqlSessionFactory.getConfiguration());
            System.out.println("Map Underscore To Camel Case: " + sqlSessionFactory.getConfiguration().isMapUnderscoreToCamelCase());
        };
    }
}
